//
// BaseSocket.h
//
// $Id: //base/include/BaseSocket.h
//
// Library: base
// Package: BaseSocket
// Module:  BaseSocket
//
// Definition of the BaseSocket class.
//
// Copyright (c) 2012-2012, iGuard.
// doitsjz@163.com	jelin
//


#ifndef BASE_SOCKET_INCLUDED
#define BASE_SOCKET_INCLUDED

#include <pjlib.h>

#include "base.h"
#include "Proactor.h"



/**
	BaseSocket for tcpsocket and udpsocket
*/

class Proactor;
class  BASE_API BaseSocket
{
public:
	BaseSocket(Proactor* proactor,int type);
	virtual ~BaseSocket();
public:
	int GetSockType();
	int GetSockHandle();
protected:
	pj_activesock_t* p_asock;
	Proactor* p_proactor;
	pj_activesock_cfg cfg;
	pj_activesock_cb cb;
	pj_ioqueue_op_key_t send_key;
	pj_sock_t sock;
	pj_sockaddr addr;
	int	sock_type;
	friend class Proactor;
};


#endif